


class BaseUtil{
    constructor(param_className){
        if(typeof (param_className) === 'undefined'){
            throw Error('声明时应传入参数:类名');
        }
        this.className = param_className;
    }
    static checkPropertyOfClass(property,value,type){
        if(typeof (type) !== 'string'){
            throw Error('参数类型应是 string 类型:具体值应如 number string boolean undefined object function symbol');
        }
        if(typeof (value) !== type){
            throw Error(`属性 ${property} 的值 ${value} 应是 ${type} 类型`);
        }
    }
}

module.exports = BaseUtil;

/*
class test{
    constructor(obj){
        this.property = {};
        for(let key of Object.keys(obj)){
            this[key] = obj[key];
        }
    }
    set name(param_name){
        BaseUtil.checkPropertyOfClass('name',param_name,'string');
        this.property.name = param_name;
    }
    get name(){
        return this.property.name;
    }
}

let t = new test({name:'123'});
t.name = 1;
console.log(t.name);*/
